package com.net;

import com.easemob.helpdesk.bean.AdminVillage;
import com.easemob.helpdesk.bean.DiscountCouponDetailInfo;
import com.easemob.helpdesk.bean.DispatchResult;
import com.easemob.helpdesk.bean.IDCardVerifyResultBean;
import com.easemob.helpdesk.bean.LevelBean;
import com.easemob.helpdesk.bean.ListTagBean;
import com.easemob.helpdesk.bean.OwnerInfoRes;
import com.easemob.helpdesk.bean.OwnerLevelInfo;
import com.easemob.helpdesk.bean.PageWithRes;
import com.easemob.helpdesk.bean.ServiceFeeBean;
import com.easemob.helpdesk.bean.SkillGroupBean;
import com.easemob.helpdesk.bean.TagBean;
import com.easemob.helpdesk.bean.UploadResult;
import com.easemob.helpdesk.bean.User;

import org.json.JSONObject;

import java.util.ArrayList;
import java.util.List;
import java.util.Map;

import okhttp3.MultipartBody;
import okhttp3.RequestBody;
import okhttp3.ResponseBody;
import retrofit2.Call;

import retrofit2.Callback;
import retrofit2.Response;
import retrofit2.http.Body;

import retrofit2.http.Field;
import retrofit2.http.FormUrlEncoded;
import retrofit2.http.GET;
import retrofit2.http.HEAD;
import retrofit2.http.Header;
import retrofit2.http.Multipart;
import retrofit2.http.POST;
import retrofit2.http.Part;
import retrofit2.http.QueryMap;
import retrofit2.http.Streaming;
import rx.Observable;

/**
 * Created by xiaolong.wei on 2018/8/13.
 */

public interface ApiService {

    @POST("account/findUserById")
    @FormUrlEncoded
    Call<BaseResponse<User>> getUserById(@Header("t") String t , @Field("uid") String uid);

    @POST("housekeeper/ownerlistsearch")
    @FormUrlEncoded
    Call<BaseResponse<PageWithRes>> getOwnerList(@Header("t") String t, @Header("user_id") String user_id , @Field("page") String page, @Field("pagesize") String pagesize, @Field("search") String search);

    @POST("order/getOwnerServiceSummary")
    @FormUrlEncoded
    Call<BaseResponse<OwnerInfoRes.DataBean>> getOwnerServiceSummary(@Header("t") String t , @Header("user_id") String user_id, @Field("kehu_id") String kehu_id);


    @POST("housekeeper/easemobLoginAfter")
    @FormUrlEncoded
    Call<BaseResponse> updateUserId(@Header("t") String t , @Field("easemob_kefu_name") String easemob_kefu_name,@Field("easemob_kefu_id") String easemob_kefu_id);

    @POST("order/rob")
    @FormUrlEncoded
    Call<BaseResponse<Boolean>> rotOrder(@Header("t") String t , @Header("user_id") String user_id,@Field("id") String id);


    @POST("housekeeper/list")
    @FormUrlEncoded
    Call<BaseResponse<DispatchResult.PageWithResBean>> getHousekeeperList(
            @Header("t") String t,
            @Field("page") String page,
            @Field("pageSize") String pageSize,
            @Field("search") String search,
            @Field("village") String village,
            @Field("homeBuilding") String homeBuilding,
            @Field("unit") String unit,
            @Field("status") String status);

    @POST("order/dispatch")
    @FormUrlEncoded
    Call<BaseResponse<Boolean>> dispatchOrder(@Header("t") String t,@Field("id") String id , @Field("keeperId") String keeperId, @Field("isDispatch") String isDispatch);


    @POST("admin/getAllCityVillage")
    Call<BaseResponse<List<AdminVillage>>> getAllCityVillage(@Header("t") String t);

    @POST("account/listHomeBuilding")
    @FormUrlEncoded
    Call<BaseResponse<ArrayList<String>>> getHomeBuildings(@Header("t") String t , @Field("city") String city , @Field("homeNeighbourhoods") String homeNeighbourhoods);

    @POST("account/listHomeUnit")
    @FormUrlEncoded
    Call<BaseResponse<ArrayList<String>>> getHomeUnits(@Header("t") String t , @Field("city") String city , @Field("homeNeighbourhoods") String homeNeighbourhoods,@Field("homeBuilding") String homeBuilding);


    @POST("config/easemob")
    Call<BaseResponse<SkillGroupBean>> getSkillGroup(@Header("t") String t);


    @POST("housekeeper/scan")
    Call<BaseResponse<DiscountCouponDetailInfo>> getDiscountCouponInfo(@Header("t") String t , @Body RequestBody qrCodeJson);


    @POST("privilege/shops/useVoucher")
    @FormUrlEncoded
    Call<BaseResponse<Object>> useDiscouneCoupon(@Header("t") String t , @Field("qrCode") String qrCode);

    @POST("housekeeper/householdsCount")
    Call<BaseResponse<Integer>> getHouseHoldsCount(@Header("t") String t);

    @POST("order/serviceFeeList")
    @FormUrlEncoded
    Call<BaseResponse<ArrayList<ServiceFeeBean>>> getServiceFeeList(@Header("t") String t,@Field("groupId") long groupId, @Field("phone") String phone , @Field("serviceTime") String serviceTime);

    @POST("userTags/insertUserTags")
    @FormUrlEncoded
    Call<BaseResponse> addTag(@Header("t") String t ,@Field("ownerId") long ownerId, @Field("tagName1") String tagType,@Field("tagName2") String tag);


    @POST("userTags/getGeneralUserTags")
    @FormUrlEncoded
    Call<BaseResponse<List<TagBean>>> getTags(@Header("t") String t, @Field("ownerId") long ownerId);

    @POST("userTags/getUserTagsDetail")
    @FormUrlEncoded
    Call<BaseResponse<ListTagBean>> getTagList(@Header("t") String t, @Field("ownerId") long ownerId);


    @POST("userTags/deleteUserTags")
    @FormUrlEncoded
    Call<BaseResponse<Object>> deleteTag(@Header("t") String t ,@Field("ownerId") long ownerId, @Field("tagName1") String tagType,@Field("tagName2") String tag);


    @POST("hlz/face/id_check")
    @FormUrlEncoded
    Call<BaseResponse<IDCardVerifyResultBean>> idCardCheck(@Header("t") String t, @Field("idName") String idName, @Field("idNum") String idNum, @Field("facePicBase64") String facePicBase64, @Field("idCardFrontPicUrl") String idCardFrontPicUrl, @Field("idCardBackPicUrl") String idCardBackPicUrl);


    //1休息
    //0开始工作
    @POST("housekeeper/changeRestStatus")
    @FormUrlEncoded
    Call<BaseResponse<Object>> changeRestStatus(@Header("t") String t , @Field("isRest") int isRest);

    @POST("housekeeper/appPreview")
    Call<BaseResponse<String>> getConstractDetail(@Header("t") String t);

    @POST("housekeeper/signContract")
    @FormUrlEncoded
    Call<BaseResponse<Object>> signContract(@Header("t") String t , @Field("shopId") int shopId);


    //实名认证
    @Multipart
    @POST("file/upload")
    Call<BaseResponse<UploadResult>> uploadBitmap(
            @Part MultipartBody.Part file,
            @Part("type") RequestBody type
    );

    @POST("order/autograph")
    @FormUrlEncoded
    Call<BaseResponse<Object>> handWritingSign(@Header("t") String t, @Field("orderId") int orderId , @Field("picId") long picId);


    @POST("order/uploadImage")
    @FormUrlEncoded
    Call<BaseResponse<Object>> updateBindImageStatus(@Header("t") String t , @Field("id") int orderId, @Field("type") String type , @Field("images") List<String> ids);


    @POST("userTags/getAllOwnerClassify")
    Call<BaseResponse<List<LevelBean>>> getAllOwnerClassify(@Header("t") String t);

    @POST("userTags/saveOwnerLevel")
    @FormUrlEncoded
    Call<BaseResponse<Object>> saveOwnerLevel(@Header("t") String t,@Field("ownerId") String ownerId , @Field("level") String level , @Field("subLevel") String subLevel);

    @POST("userTags/getOwnerLevel")
    @FormUrlEncoded
    Call<BaseResponse<OwnerLevelInfo>> getOwnerLevel(@Header("t") String t, @Field("ownerId") String ownerId);

}
